<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'showProducts.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    


  </head>
  
  <body>
  		<jsp:include page="/jsp/head.jsp"></jsp:include>
  		<a href="servlet/ProductServlet?method=getProducts" >返回</a>
  		<hr/>
  		
  	<c:set var="p"  value="${requestScope.product }"></c:set>	
  	<table width="800px" align="center">
  		<tr>
  			<td>商品名称</td>
  			<td>${p.name }</td>
  		</tr>
  		<tr>
  			<td>商品价格</td>
  			<td>${p.cost }</td>
  		</tr>
  		<tr>
  			<td>商品描述</td>
  			<td>${p.info }</td>
  		</tr>
  		<tr>
  			<td>商品图片</td>
  			<td>
  				<c:forTokens items="${p.img }" delims="," var="img">
  					<img src="${img }"  border="0"  height="80px"  width="80px" />
  				</c:forTokens>
  			</td>
  		
  		</tr>
  	</table>
  	
    
    <div align="left"">
    	<span>您的浏览记录</span>
    	<span><a href="servlet/ProductServlet?method=clearBrowserHistory">清空浏览记录</a></span>
    	<div >
    		<ul >
    			<c:forEach var="product" items="${requestScope.products }">
    				<li>
    					<span>${product.name }</span>
    				</li>
    			</c:forEach>
    		</ul>
    	</div>
    </div>
  </body>
</html>
